home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / wwbbs31_source.lha / WWBBS / Library / update.c < prev    next >
C/C++ Source or Header  |  1994-09-15  |  753b  |  32 lines

  1. #include "wwbbs.h"
  2.  
  3. #include "Data:Programs/Include/wwbbs_update.h"
  4.  
  5. __asm
  6. void SetUpdatePort(register __a0 struct MsgPort *port)
  7.     {
  8.         ObtainSemaphore(&UpdateSemaphore);
  9.         UpdatePort=port;
  10.         ReleaseSemaphore(&UpdateSemaphore);
  11.     }
  12.  
  13. __asm
  14. void SendUpdate(register __d0 UBYTE cmd,register __a0 BYTE *id)
  15.     {
  16.         ObtainSemaphoreShared(&UpdateSemaphore);
  17.         if(UpdatePort)
  18.             {
  19.                 struct UpdateMessage *msg;
  20.                 if(msg=AllocVec(sizeof(struct UpdateMessage),MEMF_CLEAR))
  21.                     {
  22.                         msg->um_Message.mn_Node.ln_Type=NT_MESSAGE;
  23.                         msg->um_Message.mn_Length=sizeof(struct UpdateMessage);
  24.                         msg->um_Command=cmd;
  25.                         if(id)
  26.                             strcpy(msg->um_ID,id);
  27.                         PutMsg(UpdatePort,(struct Message *) msg);
  28.                     }
  29.             }
  30.         ReleaseSemaphore(&UpdateSemaphore);
  31.     }
  32.